<template>
  <view class="carInfo">
    <view class="carImage">
      <image src="../../static/my-icons/编组.png" mode="widthFix"></image>
    </view>
    <view class="info">
      <view class="line">
        <text class="tit">车辆编号</text>
        <text>{{id}}</text>
      </view>
      <view class="line">
        <text class="tit">车辆号牌</text>
        <text>{{licensePlate}}</text>
      </view>
      <view class="line">
        <text class="tit">车型</text>
        <text>{{truckType}}</text>
      </view>
      <view class="line">
        <text class="tit">载重</text>
        <text>{{allowableLoad}}吨</text>
      </view>
    </view>
  </view>
</template>

<script>
  export default {
    name: '',
    components: {},
    data() {
      return {
        id:'',
        licensePlate:'',
        picture:'',
        truckType:'',
        allowableLoad:''
      };
    },
   async created(){
     // {data:{data:{id,licensePlate,picture,truckType,allowableLoad}}}
     let {data:{data:{id,licensePlate,picture,truckType,allowableLoad}}} = await uni.$http.get('/users/truck')
     // console.log(res);
     // console.log(picture);
     this.id = id
     this.licensePlate = licensePlate
     this.picture = picture
     this.truckType = truckType
     this.allowableLoad = allowableLoad
   },
    mounted(){},
    onLoad(){},
    methods: {
      
    }
  }
</script>

<style lang="scss">
  page {
    background-color: #F4F4F4;
  .carInfo {
    padding: 15px;
    // background-color: #F4F4F4;
    .carImage {
      width: 345px;
      height: 201px;
      // background-color: pink;
      image {
        width: 100%;
        height: 100%;
      }
    }
    .info {
      padding: 20px;
      margin-top: 12px;
      border-radius: 10px;
      background-color: #fff;
      .line {
        display: flex;
        justify-content: space-between;
        align-items: center;
        height: 40px;
        font-size: 14px;
        .tit {
          color: #818181;
        }
        text {
          color: #2A2929;
        }
      }
    }
  }
   }
</style>
